package part.p1;

public class Circle extends Shape {
    private int r;

    public Circle(int x, int y) {
        super(x, y);
    }


    public Circle(int x, int y, int r) {
        super(x, y);
        this.r = r;
    }

    public void setR(int r) {
        this.r = r;
    }

    public int getR() {
        return r;
    }

    public double getArea() {
        return 3.14 * r * r;
    }

    public String toString() {
        return super.toString() + "  Circle = [r = " + r + "]";
    }

    public boolean equals(Object that) {
        if (that == this) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (that.getClass() != this.getClass()) {
            return false;
        }
        Circle thatCircle = (Circle)that;
        return super.equals(that) && thatCircle.r == this.r;
    }
}
